Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(instance): add terminate command #998

Merged
merged 6 commits into from
May 6, 2020

Conversation

jawher
Copy link
Contributor

@jawher jawher commented May 4, 2020

This command uses the server action API: with action=terminate https://developers.scaleway.com/en/products/instance/api/#post-049a5b to quickly delete an instance without backing up its attached volumes.

Options:

  • with-ip: also delete the flexible IPs
  • with-block: by default, terminate will delete the block storage volumes. When false, the command will detach the block volumes before calling terminate

What remains to be decided:

  • default value for with-block: true to match the API/SDK or false to avoid accidental data loss (though when you call terminate, you should expect stuff to be ... terminated.

Closes #921

TODO

This command uses the server action API: with `action=terminate` https://developers.scaleway.com/en/products/instance/api/#post-049a5b to quickly delete an instance without backing up its attached volumes.

Options:

* `with-ip`: also delete the flexible IPs
* `with-block`: by default, `terminate` will delete the block storage volumes. When `false`, the command will detach the block volumes before calling `terminate`
@remyleone remyleone linked an issue May 4, 2020 that may be closed by this pull request
@remyleone
Copy link
Member

Maybe we could add an interactive question when with-block is not specified.

@jawher
Copy link
Contributor Author

jawher commented May 5, 2020

@remyleone terminate will now prompt the user iff:

  • neither with-block=true nor with-block=false is specified
  • the instance has at least one block volume attached

example:

$ scw instance server terminate 9b8ca1c9-f062-4d58-8a62-b6f8c7d0fff7 with-ip=true
Do you want to also delete the block volumes attached to this instance ? (y/N):
successfully detached volume cli-srv-goofy-rubin-1
successfully deleted ip x.x.x.x
✅ Success.

@jawher jawher force-pushed the instance-terminate branch from 71fd6f7 to b033f53 Compare May 5, 2020 07:17
remyleone
remyleone previously approved these changes May 5, 2020
Copy link
Contributor

@jerome-quere jerome-quere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@remyleone remyleone merged commit 76fbcaf into scaleway:v2 May 6, 2020
@remyleone remyleone added this to the v2.0.0-beta.3 milestone May 6, 2020
@remyleone remyleone self-assigned this May 6, 2020
@jawher jawher deleted the instance-terminate branch July 3, 2020 13:55
@remyleone remyleone added the instance Instance issues, bugs and feature requests label Jul 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
instance Instance issues, bugs and feature requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for instance terminate action
3 participants